import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import { router } from './router/index.js'
import axios from './http/http'
import { createPinia } from 'pinia'
import {
  createDiscreteApi,
} from "naive-ui";
const { message, notification, dialog, loadingBar } = createDiscreteApi(
  ["message", "dialog", "notification", "loadingBar"],
);

const app = createApp(App);

app.use(router);

// 全局配置axios
app.provide('axios', axios)
app.provide('message', message)
app.provide('notification', notification)
app.provide('dialog', dialog)
app.provide('loadingBar', loadingBar)

const pinia = createPinia()
app.use(pinia)


/* 
 import { inject } from 'vue'
  const $axios = inject('$axios')
  $axios.get(url').then((resp) => {    
    console.log(resp.data)
  }).catch((err) => {
    console.log(err)
})
*/

app.mount('#app');
